package com.szzg10.thinking.chapter18;

import java.nio.charset.Charset;
import java.util.Set;
import java.util.SortedMap;

public class AvailableCharSets {

	public static void main(String[] args) {
		SortedMap<String, Charset> charsets = Charset.availableCharsets();
		
		Set<String> keySet = charsets.keySet();
		for(String element: keySet) {
			System.out.print(element + ": ");
			
			Set<String> aliases = charsets.get(element).aliases();
			for(String subElement: aliases) {
				System.out.print(subElement + ", ");
			}
			
			System.out.println();
			System.out.println();
		}
	}
}
